package com.yq.cp.mapper.data;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yq.cp.entity.common.PageVo;
import com.yq.cp.entity.data.HourPrice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zh
 * @since 2023-03-17
 */
public interface HourPriceMapper extends BaseMapper<HourPrice> {

    BigDecimal minDj(@Param("v") PageVo pageVo, @Param("h1") String h1, @Param("h2") String h2);
    BigDecimal maxDj(@Param("v") PageVo pageVo,@Param("h1") String h1,@Param("h2") String h2);

    @Select("SELECT unit_price FROM t_hour_price WHERE type=#{type} AND classify=#{classify} AND is_delete=0 LIMIT 0,1")
    BigDecimal queryPrice(@Param("type") Integer type,@Param("classify") Integer classify);
    @Select("SELECT unit_price FROM t_hour_price WHERE type=#{type} AND classify=#{classify} AND energy_id=#{id} AND is_delete=0 LIMIT 0,1")
    BigDecimal queryPrice1(@Param("type") Integer type,@Param("classify") Integer classify,@Param("id") Long id);
}
